package org.neframework.webtest.service;

import java.util.List;
import java.util.Map;

import com.tmsps.neframework.core.common.page.Page;
import com.tmsps.neframework.jpa.base.BaseService;
import com.tmsps.neframework.jpa.sql.param.NeParamList;

public class BankService extends BaseService {

	public static void main(String[] args) {
		BankService s = new BankService();
		System.err.println(s.selectBankList());
	}

	public List<Map<String, Object>> selectBankList() {
		String sql = "select * from t_s_bank t where t.status=0 order by t.name asc";
		List<Map<String, Object>> list = jc.queryForList(sql);
		return list;
	}

	public List<Map<String, Object>> selectBankList(String srh_name,
			Map<String, String> sort_params, Page page) {
		if (sort_params.isEmpty()) {
			sort_params.put("name", "asc");
		}
		String sql = "select * from t_s_bank t where t.status=0 and (t.name like ?) ";
		NeParamList param = NeParamList.makeParams();
		param.addLike(srh_name);

		List<Map<String, Object>> list = jcn.queryForList(sql, param,
				sort_params, page);
		return list;
	}

}
